Heading TAG IN HTML

Heading tags in HTML, ranging from <h1> to <h6>, structure text content, indicating hierarchy and importance within a document. <h1> represents the main heading, typically the title of the page, while <h2> to <h6> denote subheadings of decreasing significance. Search engines and screen readers use these tags to understand content structure, impacting SEO and accessibility. Proper use of heading tags organizes content logically, aiding navigation and readability on web pages.


  • Example of Heading Tag :
  • <h1> tag :
    The <h2> to <h6> tags in HTML are part of the markup language's structure for organizing and presenting content. These tags are used to create headings and subheadings with varying levels of importance and hierarchy within a document.

    <!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1>Welcome to PBA Institute.</h1> </body> </html>

    Output :

    Welcome to PBA Institute.

    <h2> to <6> tag :

    <!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1>Main Heading..</h1> <h2>h2 heading tag..</h2> <h3>h3 heading tag..</h3> <h4>h4 heading tag..</h3> <h5>h5 heading tag..</h2> <h6>h6 heading tag..</h3> </body> </html>

    Output :

    Main Heading

    h2 heading tag..

    h3 heading tag..

    h4 heading tag..

    h5 heading tag..
    h6 heading tag..
  • Conclusion :
  • .